<?php
$sql="select orders.*,user.username,status.name from orders,user,status where orders.user_id=user.id and orders.status_id=status.id and orders.user_id={$_SESSION['home_userid']} order by orders.id";
$rst=$mysqli->query($sql);
?>


<table border='1' cellspacing='0' width='100%'>
    <tr>
        <th>订单号</th>
        <th>下单时间</th>
        <th>订单状态</th>
    </tr>
    <?php
    while($row=$rst->fetch_assoc()){
        echo "<tr>";
        echo "<td><a href='index.php?action=code&code={$row['code']}'>{$row['code']}</a></td>";
        echo "<td>".date('Y-m-d H:i:s',$row['time'])."</td>";
        echo "<td>{$row['name']}</td>";
        echo "</tr>";
    }
    ?>

</table>
